From 2a2f95d00d10122a971195a4b301955f4f740563 Mon Sep 17 00:00:00 2001 From: Corey Farwell Date: Mon, 2 May 2016 21:17:01 -0400 Subject: [PATCH] Remove unnecessary `Vec` allocation when iterating. --- src/cargo/util/toml.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/cargo/util/toml.rs b/src/cargo/util/toml.rs index 5cd4ad43b..288aa2be5 100644 --- a/src/cargo/util/toml.rs +++ b/src/cargo/util/toml.rs @@ -626,9 +626,8 @@ impl TomlManifest { /// Will check a list of toml targets, and make sure the target names are unique within a vector. /// If not, the name of the offending binary target is returned. fn unique_names_in_targets(targets: &[TomlTarget]) -> Result<(), String> { - let values = targets.iter().map(|e| e.name()).collect::>(); let mut seen = HashSet::new(); - for v in values { + for v in targets.iter().map(|e| e.name()) { if !seen.insert(v.clone()) { return Err(v); } -- 2.30.2